<template>
  <div class="see-example" @click="isDialog = true" >
    <el-icon color="#999"> <Warning /> </el-icon>查看航站区事件库样例
  </div>
  <el-dialog v-model="isDialog" width="80%">
    <!-- <embed :src="fileURL" type="text/xml" width="100%" height="600px" /> -->
    <div style="height: 80vh; overflow-y: auto">
      <img :src="imgSrc" alt="" style="width: 100%" />
    </div>
  </el-dialog>
</template>

<script setup>
import { ref, onBeforeMount } from "vue";
import { exportSampleImage } from "@/api/collaborativeCommand/eventEscalation";
const props = defineProps({});
const isDialog = ref(false);
const fileURL = ref("");
const imgSrc = ref(require("@/assets/images/sampleDiagram.jpg"));
// onBeforeMount(() => {
//   exportSampleImage().then((res) => {
//     console.log(res);
// const link = document.createElement("a");
// const blob = new Blob([res], { type: "application/vnd.ms-excel" });
// link.style.display = "none";
// link.href = URL.createObjectURL(blob);
// link.setAttribute("download", `1111.xlsx`);
// document.body.appendChild(link);
// link.click();
// document.body.removeChild(link);
// fileURL.value = window.URL.createObjectURL(new Blob([res]));
// var reader = new FileReader();
// reader.onload = function () {
//   fileURL.value = window.URL.createObjectURL(
//     new Blob([reader.result], { type: "text/xml" })
//   );
// };
// reader.readAsText(new Blob([res.data]));
//   });
// });
</script>

<style lang="less" scoped>
.see-example {
  display: flex;
  align-items: center;
  position: absolute;
  right: 0;
  color: #999;
  cursor: pointer;

  i {
    margin-right: 7px;
  }
}
</style>
